﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace SscLib
{
    /// <summary>
    /// Defines a Field symbol.
    /// </summary>
    public class FieldSymbol : Symbol
    {
        /// <summary>Reflection metadata for this Field symbol.</summary>
        public FieldInfo Info;

        /// <summary>
        /// Creates a new Field symbol with name, type and containing scope.
        /// </summary>
        /// <param name="name">Field name.</param>
        /// <param name="type">Field type.</param>
        internal FieldSymbol(string name, TypeSymbol type)
            : base(name, type)
        {
        }

        /// <summary>
        /// Returns a string that represents this Field symbol.
        /// </summary>
        /// <returns>Returns a string representation of this Field symbol.</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("Field({0})", base.ToString());
            return sb.ToString();
        }
    }
}
